package com.example.yiqiuser.controller;


import com.example.yiqiuser.entity.NeChannel;
import com.example.yiqiuser.service.NeChannelService;
import com.example.yiqiuser.util.Page;
import com.example.yiqiuser.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @create by: 周文达 (3220083246@qq.com)
 * @description:
 * @create time: 2023/4/12 22:35
 * @return
 */
@RestController
@RequestMapping("channel")
public class NeChannelController extends BaseController {

    @Resource
    private NeChannelService neChannelService;

    @PostMapping("queryPage")
    public Result queryPage(@RequestBody Page<NeChannel> page){
        return success(neChannelService.queryByParams(page));
    }

    @PostMapping("adds")
    public Result adds(@RequestBody NeChannel neChannel){
        return success(neChannelService.adds(neChannel));
    }

    @GetMapping("queryById")
    public Result queryById(int id){
        return success(neChannelService.queryById(id));
    }

    @DeleteMapping("delete")
    public Result deleteById(int id){
        return success(neChannelService.delete(id));
    }
    @PostMapping("update")
    public Result update(@RequestBody NeChannel neChannel){
        return success(neChannelService.update(neChannel));
    }
}
